package com.superm.mappers;

import com.superm.entity.RelationShip;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface RelationShipMapper {
    /**
     * 根据指定条件查询信息
     * @param relationShip
     * @return
     */
    List<RelationShip> selectInfoMation(@Param("relationShip")RelationShip relationShip,@Param("pageNo")Integer pageNo,@Param("pageSize") Integer pageSize);


    /**
     * 查询总条数
     * @param relationShip
     * @return
     */
    int selectInfoMationCount(@Param("relationShip")RelationShip relationShip);


    /**
     * 根据编号查询指定的类型信息
     * @param relationshipId
     * @return
     */
    RelationShip selectIdInfoMation(@Param("relationshipId")Integer relationshipId);


    /**
     * 查询最大级类型
     * @return
     */
    List<RelationShip> selectMaxInfoMation();




    /**
     * 修改类型信息
     * @param relationShip
     * @return
     */
    int updateInfoMation(@Param("relationShip") RelationShip relationShip);


    /**
     * 修改一级类型信息
     * @param relationShip
     * @return
     */
    int updateInfoMationOne(@Param("relationShip") RelationShip relationShip);
    /**
     * 添加一级分类
     * @param relationShipName
     * @return
     */
    int addOneInfoMation(@Param("relationShipName") String relationShipName);


    /**
     * 添加二级分类
     * @param relationShip
     * @return
     */
    int addTowInfoMation(@Param("relationShip") RelationShip relationShip);

    /**
     * 删除分类信息
     * @param relationShipId
     * @return
     */
    int deleteInfoMation(@Param("relationShipId") Integer relationShipId);


    /**
     * 查询所属父级的
     * @param pId
     * @return
     */
    int selectPidCount(@Param("pId") Integer pId);

    /**
     * 根据父级编号查询所有的子
     * @param pId
     * @return
     */
    List<RelationShip> selectPidList(@Param("pId") Integer pId);


}
